package com.jcark.arch.net

import android.content.ContentProvider
import android.content.ContentValues
import android.net.Uri
import android.util.Log
import com.jcark.arch.net.state.NetWorkMonitorManager
import me.hgj.mvvm.ext.util.TAG

class NetWorkContentProvider : ContentProvider() {

    override fun delete(uri: Uri, selection: String?, selectionArgs: Array<String>?) = 0

    override fun getType(uri: Uri) = ""

    override fun insert(uri: Uri, values: ContentValues?) = null

    override fun onCreate(): Boolean {
        Log.e(TAG, "NetWork ContentProvider init...")
        NetWorkMonitorManager.init(context)
        return false
    }

    override fun query(
        uri: Uri, projection: Array<String>?, selection: String?,
        selectionArgs: Array<String>?, sortOrder: String?
    ) = null

    override fun update(
        uri: Uri, values: ContentValues?, selection: String?,
        selectionArgs: Array<String>?
    ) = 0
}